
#include "nane/SoundSystem/SoundSource3DImpl_.h"

namespace nane
{
    ////////////////////////////////////////////////////////////////////////////////////////////////
    SoundSource3D::Implementation::Implementation( SoundSystem::Implementation* _creator, ISoundSource3D* _interface )
        : SubSystemProductImpl<SoundSource3D::Implementation, SoundSystem::Implementation, ISoundSource3D*, SoundSource::Implementation>( _creator, _interface )
        , posX( 0.0f )
        , posY( 0.0f )
        , posZ( 0.0f )
        , velX( 0.0f )
        , velY( 0.0f )
        , velZ( 0.0f )
    {

    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    bool SoundSource3D::Implementation::Update( uint32 _ms )
    {
        switch( state.raw_value() )
        {
        case EState::Stopped:
            break;
        case EState::PendingPlay:
            creator->interface->SetSource3DPosition(static_cast<ISoundSource3D*>(interface), posX, posY, posZ);
            creator->interface->SetSource3DVelocity(static_cast<ISoundSource3D*>(interface), velX, velY, velZ);
            break;
        case EState::Playing:
            break;
        case EState::PendingStop:
            break;
        default:
            ;
        }
        return SoundSource::Implementation::Update(_ms);
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
}   // namespace nane
